package com.spyx.activity;

import com.atyx.spyx.model.activity.CouponInfo;
import com.atyx.spyx.model.order.CartInfo;
import com.atyx.spyx.vo.order.CartInfoVo;
import com.atyx.spyx.vo.order.OrderConfirmVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient(value = "service-activity") //value="项目的名称"
public interface ActivityClient {
    @PostMapping("/api/activity/inner/findActivity")
    public Map findactivityRule(@RequestBody List<Long> skuidList);

    @GetMapping("/api/activity/inner/findActivityAndCoupon/{skuId}/{userId}")
    public Map<String, Object> findActivityAndCoupon(@PathVariable Long skuId,
                                                     @PathVariable("userId") Long userId);

    //根据用户id和购物车列表信息，查看商品参加的优惠活动和优惠券- service-activity
    @PostMapping("/api/activity/inner/findCartActivityAndCoupon/{userId}")
    public OrderConfirmVo findCartActivityAndCoupon(@RequestBody List<CartInfo> cartInfoList, @PathVariable("userId") Long userId);

    @PostMapping("/api/activity/inner/findCartActivityList")
    public List<CartInfoVo> findCartActivityList(@RequestBody  List<CartInfo> cartInfoList);

    @PostMapping("/api/activity/inner/findRangeSkuIdList/{couponId}")
    public CouponInfo findRangeSkuIdList(@RequestBody List<CartInfo> cartInfoList,
                                         @PathVariable("couponId")Long couponId);

    @GetMapping(value = "/api/activity/inner/updateCouponInfoUseStatus/{couponId}/{userId}/{orderId}")
    public  void updateCouponInfoUseStatus(
            @PathVariable("userId") Long userId,
            @PathVariable("couponId") Long couponId,
            @PathVariable("orderId") Long orderId);

}
